package com.poetry.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.poetry.domain.dto.PoemDoc;
import com.poetry.domain.po.Poem;
import com.poetry.domain.po.Search;
import com.poetry.exception.R;
import com.poetry.exception.SearchResult;

import java.util.List;

public interface ISearchService extends IService<Search> {

    R<SearchResult<PoemDoc>> searchPoems(String query, String type, String dynasty, String author, int page, int size);

    R<List<String>> getSuggestions(String prefix, int size);

    R<String> addHistory(String content);

    R<List<Search>> queryHistory(Integer limit);

    R<String> clearHistory();

    void addOrUpdatePoem(Poem poem);

    void deletePoem(List<Integer> poemId);
}
